import { createStore } from "redux";
import methods from './methods';
import state1 from './state';

// 初始化store
let ActionFnObj = methods;
// let state = state;
//创建出reducer函数
function reducer(state=state1,action) { 
    if(action.type.indexOf('redux')===-1){
         state = ActionFnObj[action.type](state,action);
        return {...state}
    }else{
        return state
    }
 }
 const store = createStore(reducer);
 export default store;